// $(".focus-img-box").slide({
//     mainCell:".bd ul",
//     titCell:'.hd ul',
//     effect:"fold",
//     autoPlay:true,
//     autoPage: true,
//     interTime:5000
// });
var canLoad = true;
var pageStart = 1;
function zixunTemplate(){
  $(window).scroll(function(){
    var iH = $(document).height() - $(window).height();
    var sH = $(window).scrollTop();
    if(sH >= iH && canLoad){
		canLoad = false;
		pageStart++;
		$.ajax({
			url : '/indexGetPage',
			type : 'post',
			data : JSON.stringify({
					type : '',
					page : pageStart
				}),
			contentType: 'application/json',
			success:function(d){
				if(d.length > 0){
				    var html = '';
					$.each(d,function(i){
						if(i%2 == 1){
							html += '<a href="/article/' + this.id + '.html">\n' + 
									'<div class="news-box">\n'+
									'<div class="news-img"><img data-src="' + this.thumb + '" class="lazyload"></div>\n'+
            						'<div class="news-desc">\n'+
      									'<h3>' + this.title + '</h3>\n'+
                						'<p>' + this.newsdesc + '</p>\n'+
            						'</div>\n' +
            						'</div>\n' +
									'</a>';
						}else{
							html += '<a href="/article/' + this.id + '.html">\n' + 
									'<div class="news-box">\n'+
									'<div class="news-desc">\n'+
      									'<h3>' + this.title + '</h3>\n'+
                						'<p>' + this.newsdesc + '</p>\n'+
            						'</div>\n' +
									'<div class="news-img"><img data-src="' + this.thumb + '" class="lazyload"></div>\n'+
            						'</div>\n' +
									'</a>';
						}
					})
					$('.main').append(html);
					lazyload();
					canLoad = true;
				};
			}
		})
    }
  })
}
zixunTemplate();
lazyload();